//
//  AdmissionsCardCell.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/18.
//

#import "AdmissionsCardCell.h"

@implementation AdmissionsCardCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self creatcelllist];
    }
    return self;
}

-(void)creatcelllist{
    
    UIView *backV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 130)];
    backV.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:backV];

    
    UIView *backGrayV = [[UIView alloc]initWithFrame:CGRectMake(10, 10,APPwidth-20, 110)];
    backGrayV.backgroundColor = rgba(245, 245, 250, 1);
    backGrayV.layer.cornerRadius = 10;
    [backV addSubview:backGrayV];

    UILabel *typeLab = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, backGrayV.frame.size.width-30, 20)];
    typeLab.text = @"C1    普通班    ￥3500";
    typeLab.textColor = [UIColor blackColor];
    typeLab.textAlignment = 0;
    typeLab.font = [UIFont boldSystemFontOfSize:16];
    [backGrayV addSubview:typeLab];
    NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:typeLab.text];
    [str addAttribute:NSForegroundColorAttributeName value:rgba(38, 194, 126, 1) range:NSMakeRange(typeLab.text.length-5, 5)];
    [str addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:16] range:NSMakeRange(typeLab.text.length-5, 5)];
    typeLab.attributedText= str;
//
    
    UILabel *CoachPickUpLab = [[UILabel alloc]initWithFrame:CGRectMake(15, typeLab.frame.size.height+typeLab.frame.origin.y+15, backGrayV.frame.size.width - 60, 15)];
    CoachPickUpLab.text = @"教练接送  周一到周五训练  四人一车";
    CoachPickUpLab.textColor = rgba(51, 51, 51, 1);
    CoachPickUpLab.layer.backgroundColor = rgba(245, 245, 250, 1).CGColor;
    CoachPickUpLab.textAlignment = 0;
    CoachPickUpLab.layer.cornerRadius = 10;
    CoachPickUpLab.font = [UIFont systemFontOfSize:14];
    [backGrayV addSubview:CoachPickUpLab];
    
    UIButton *weiteBtn = [[UIButton alloc]initWithFrame:CGRectMake(backGrayV.frame.size.width - 80, backGrayV.frame.size.height/2-10, 20, 20)];
    [weiteBtn setImage:[UIImage imageNamed:@""] forState:0];
    weiteBtn.backgroundColor = [UIColor redColor];
    [backGrayV addSubview:weiteBtn];
    
    UIButton *delateBtn = [[UIButton alloc]initWithFrame:CGRectMake(backGrayV.frame.size.width - 40, backGrayV.frame.size.height/2-10, 20, 20)];
    [delateBtn setImage:[UIImage imageNamed:@""] forState:0];
    delateBtn.backgroundColor = [UIColor greenColor];
    [backGrayV addSubview:delateBtn];
    
    
    UILabel *takeTimeLab = [[UILabel alloc]initWithFrame:CGRectMake(15,CoachPickUpLab.frame.size.height + CoachPickUpLab.frame.origin.y+20, backGrayV.frame.size.width-30, 15)];
    takeTimeLab.text = @"拿本时间:180天以内";
    takeTimeLab.textColor = rgba(138, 138, 138, 1);
    takeTimeLab.layer.backgroundColor = rgba(245, 245, 250, 1).CGColor;
    takeTimeLab.textAlignment = 0;
    takeTimeLab.layer.cornerRadius = 10;
    takeTimeLab.font = [UIFont systemFontOfSize:14];
    [backGrayV addSubview:takeTimeLab];
    



}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
